#include <stdio.h>

int main ()
{

    int array1 [10] = { 0 } , array2 [10] = { 0 } , tmp [10] = { 0 } ;

    for (int i = 0 ; i < 10 ; i++)
    {

        scanf("%d" , &array1 [i]) ;

    }

    for (int i = 0 ; i < 10 ; i++)
    {

        scanf("%d" , &array2 [i]) ;

    }

    for (int i = 0 ; i < 10 ; i++)
    {

        tmp [i] = array1 [i] ;

        array1 [i] = array2 [i] ;

        array2 [i] = tmp [i] ;

    }

    for (int i = 0 ; i < 10 ; i++)
    {

        printf("%d " , array1 [i]) ;
        
    }

    printf("\n") ;

    for (int i = 0 ; i < 10 ; i++)
    {

        printf("%d " , array2 [i]) ;

    }

    return 0 ;

}